﻿using System;
using Volo.Abp;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.MultiTenancy;

namespace mozhi.smarterp.BasicData.Currencies
{
    public class ExchangeRate : AuditedAggregateRoot<Guid>, IMultiTenant
    {
        public Guid? TenantId { get; private set; }

        public Guid CurrencyId { private set; get; }

        public DateTime Date { private set; get; }

        public decimal Value { private set; get; }

        private ExchangeRate() { }

        public ExchangeRate(Guid id, Guid currencyId, DateTime date, decimal rate)
        {
            Check.NotNull(id, "Id");
            Check.NotNull(date, "Code");
            Check.NotNull(rate, "Rate");
            Check.NotNull(CurrencyId, "Rate");

            Id = id;
            CurrencyId = currencyId;
            Date = date;
            Value = rate;
            CurrencyId = currencyId;
        }
    }
}
